/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package processors;

import Errors.ErrorInformation;
import checker.checkerUser;

/**
 *
 * @author Chris
 */
public class processorLogin extends processor {
    processorLogin(String query) { super(query); }
    
    @Override
    String process() {
        checkerUser CU = new checkerUser();
        if(!CU.isValid(_queryString)) {
            if(ErrorInformation.ERRORS.INVALID_PW == CU.lastError()) {
                return "<login><validity>2</validity></login>";
            }
            return "<login><validity>1</validity></login>";
        }
        
        return "<login><validity>0</validity></login>";
    }
}
